﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.ObjectModel;

namespace ChinaColorDisplay
{
   public  class MainViewModel
    {

        public ObservableCollection<ColorInfo> Colors { get; set; } = new ObservableCollection<ColorInfo>();

        public void Load()
        {
            string jsonContent= Utility.GetEmbedTextResource(this.GetType().Assembly, "ChinaColors.json");
            var colors= jsonContent.JsonFromString<List<ColorInfo>>();
            colors.ForEach(p=>this.Colors.Add(p));
        }
    }
}
